import {RouteRecordRaw} from "vue-router"

export const menus = [
        {
            path: '/index',
            name: 'index',
            component: () => import('./modules/index.vue'),
            meta: {
                title: '首页'
            }
        },
        {
            path: '/info',
            name: 'info',
            component: () => import('./modules/info.vue'),
            meta: {
                title: '鲜花信息'
            }
        },
        {
            path: '/infoTon',
            name: 'infoTon',
            component: () => import('./modules/infoTon.vue'),
            meta: {
                title: '鲜花资讯'
            }
        },
        {
            path: '/come',
            name: 'come',
            component: () => import('./modules/come.vue'),
            meta: {
                title: '猜你喜欢'
            }
        },
        {
            path: '/carrel',
            name: 'carrel',
            component: () => import('./modules/carrel.vue'),
            meta: {
                title: '购物车'
            }
        },
        {
            path: '/order',
            name: 'order',
            component: () => import('./modules/order.vue'),
            meta: {
                title: '我的订单'
            }
        },
        {
            path: '/raccoon',
            name: 'raccoon',
            component: () => import('./modules/raccoon.vue'),
            meta: {
                title: '我的收藏'
            }
        }
    ]
;

export const children: any = [
    {
        path: '/info-details',
        name: 'info-details',
        component:()=>import('./modules/info-details.vue'),
        meta: {title: '鲜花详情'}
    },
    {
        path: '/infoTon-details',
        name: 'infoTon-details',
        component:()=>import('./modules/infoTon-details.vue'),
        meta: {title: '资讯详情'}
    },
    {
        path: '/vip',
        name: 'vip',
        component:()=>import('./modules/vip.vue'),
        meta: {title: '会员中心'}
    },
    {
        path: '/userInfo',
        name: 'userInfo',
        component:()=>import('./modules/userInfo.vue'),
        meta: {title: '个人中心'}
    },
    {
        path: '/up-pw',
        name:'up-pw',
        component:()=>import('./modules/up-pw.vue'),
        meta: {title: '修改密码'}
    },
    {
        path:'/checkout',
        name:'checkout',
        component:()=>import('./modules/checkout.vue'),
        meta: {title: '结账'}
    },
    {
        path:'/info-order',
        name:'info-order',
        component:()=>import('./modules/infoOrder.vue'),
        meta: {title: '订单详情'}
    }
]
for (let i = 0; i < menus.length; i++) {
    children.push(menus[i])
}

const routes: RouteRecordRaw[] = [
    {
        path: '/login',
        name: 'login',
        component: () => import('./modules/login.vue'),
        meta: {
            title: '登录',
            isShow: false
        }
    },
    {
        path: '/',
        component: () => import('./modules/layout.vue'),
        children: children
    }
]
export default routes
